<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<link href="<%=request.getContextPath()%>/css/reset.css" rel="stylesheet" type="text/css"/>
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript">
<!--
	function check(){
		if(document.form1.fileName.value == ""){
			alert("请选择要上传的文件！");
			document.form1.fileName.focus();
			return false;
		}
	}
//-->
</script>

<c:if test="${!empty error}">
<script>
	alert("上传文件失败，请注意文件上传格式！");
</script>
</c:if>
<c:if test="${!empty fileName}">
<script>
	var fileName = "${fileName}";
	parent.document.getElementById("fileName").innerHTML = "<font color=\"#FF0000\">文件成功上传：" + fileName + "</font>";
	parent.document.form1.myFileInfoFileUrl.value = fileName;
</script>
</c:if>
<table border="0" width="100%">
 <tr>
   <td>
<form name="form1" action="<%=request.getContextPath()%>/MyFileUpload.do?method=upload" method="post" enctype="multipart/form-data" onsubmit="return check()">
<input type="file" name="fileName"><input class="buttonupload" type="submit" value="上传">
</form>
   </td>
  </tr>
</table>